<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="../../jsfile/layer.css">
    <script src="../../jsfile/jquery.js"></script>
    <script src="../../jsfile/layer.js"></script>
    <script src="../../jsfile/base.js"></script>

    <style type="text/css">
        div, span, p {
            width: 140px;
            height: 140px;
            margin: 5px;
            background: #aaa;
            border: #000 1px solid;
            float: left;
            font-size: 17px;
            font-family: Verdana;
        }

        div.mini {
            width: 55px;
            height: 55px;
            background-color: #aaa;
            font-size: 12px;
        }

        div.hide {
            display: none;
        }
    </style>

    <script type="text/javascript">
        $(document).ready(function (){
            function anmateIt(){
                $("#mover").slideToggle("slow" , anmateIt);
            }
            anmateIt();
        });

        /**
         * :hidden
         * :visible
         */
        $(document).ready(function (){
            //1.选取所有可见的div元素
            $("#btn1").click(function (){
                $("div:visible").css("background" , "#bbffaa");
            });

            //选取所有的不可见的div元素
            //不可见:display()属性设置为none , 或者visible设置为hidden
            $("#btn2").click(function(){
                $("div:hidden,div:visible:hidden").css({"background" : "#bbffaa" , "display" : "block"});
            });

            //3.选择所有不可见的input元素
            $("#btn3").click(() => {
                alert($("input[type=hidden]").length);
            });

        });

    </script>
</head>
<body>

<input type="button" value="选取所有可见的  div 元素" id="btn1">
<input type="button" value="选择所有不可见的 div 元素" id="btn2" />
<input type="button" value="选择所有不可见的 input 元素" id="btn3" />

<br>
<div class="one" id="one">
    id 为 one,class 为 one 的div
    <div class="mini">class为mini</div>
</div>
<div class="one" id="two" title="test">
    id为two,class为one,title为test的div
    <div class="mini" title="other">class为mini,title为other</div>
    <div class="mini" title="test">class为mini,title为test</div>
</div>
<div class="one">
    <div class="mini">class为mini</div>
    <div class="mini">class为mini</div>
    <div class="mini">class为mini</div>
    <div class="mini" style="display: none"></div>
</div>
<div class="one">
    <div class="mini">class为mini</div>
    <div class="mini">class为mini</div>
    <div class="mini">class为mini</div>
    <div class="mini" title="tesst">class为mini,title为tesst</div>
</div>
<div style="display:none;" class="none">style的display为"none"的div</div>
<div class="hide">class为"hide"的div</div>
<div>
    包含input的type为"hidden"的div<input type="hidden" value="123456789" size="8">
</div>
<div id="mover">正在执行动画的div元素.</div>

</body>
</html>